import React from 'react'
import { breadcrumbs } from '../../configs/breadcrumbs'
import { Breadcrumb } from 'antd'
import { Link, useLocation } from 'react-router-dom'

export default function Role() {
  const location = useLocation()
  
  const curBreadCrumbs = Object.entries(breadcrumbs).filter(item => item[0] === location.pathname)  
 
  return (
    <div>
      <Breadcrumb>
        {
          curBreadCrumbs.map(item =>{
            return <Breadcrumb.Item key={item[1]}>
              {
                item[1].map(item1 =>{
                  return <Link to={item1.link}>{item1.title}<span  style={{margin:"0 5px"}}>/</span></Link>
                })
              }
            </Breadcrumb.Item>
          })
        }
      </Breadcrumb>
    </div>
  )
}
